import axiosInstance from "@/services/http";
import type { Result, StoreBaseInfo } from "@/types";


export async function getStoreInfo(): Promise<Result<StoreBaseInfo>> {
    return await axiosInstance.get("/store/info");
};

export async function updateStoreInfo(data: StoreBaseInfo): Promise<Result<StoreBaseInfo>> {
    return await axiosInstance.put("/store", data);
};

export async function getStoreStatus(storeIdId: number): Promise<Result<number>> {
    return await axiosInstance.get("/store/status", { params: { storeId: storeIdId } });
};

export async function setStoreStatus(storeId: number, status: number): Promise<Result<StoreBaseInfo>> {
    return await axiosInstance.put(`/store/${storeId}/${status}`);
};